<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>修改密码</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../public/layui-v2.5.5/css/layui.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
        .layui-form-item .layui-form-label{
            font-size: 15px;
            width: 90px;
        }
        .layui-btn{
            background-color: #86a0f3;
        }
        .layui-form-checked span, .layui-form-checked:hover span {
            background-color: #86a0f3
        }
        .layui-form-radio>i:hover, .layui-form-radioed>i {
            color: #86a0f3
        }
        .layui-form-checked i, .layui-form-checked:hover i {
            color: #86a0f3
        }
        .layui-input-block {
            margin-left: 100px;
        }
    </style>
    <link rel="stylesheet" href="../css/head.css"/>
    <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/bootstrap-3.3.4.css">
    <link rel="stylesheet" href="../css/reset.css" />
</head>
<body>
<!-- 导航 -->
<div class="layuimini-container">
<!--    http://localhost:8080/Counselor_System/home/modifyPassword-->
    <form class="layui-form" method="post" action="http://159.75.52.87/Counselor_System/home/modifyPassword" enctype="multipart/form-data" id="Form" onsubmit="return checkForm()">
        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-block">
                <input type="password" name="newpwd" required lay-verify="required" placeholder="请输入新密码" autocomplete="off" class="layui-input" id="newpwd">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-block">
                <input type="password" required lay-verify="required" placeholder="请再次输入新密码" autocomplete="off" class="layui-input" id="cnewpwd">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn " lay-submit lay-filter="saveBtn" type="submit">确认修改</button>
                <button type="reset" class="layui-btn layui-btn-primary" style="color: white;">重置</button>
            </div>
        </div>
    </form>
</div>
<script src="../public/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../public/wangEditor.min.js"></script>
<script>
    //修改密码
    function checkForm(){
        var form = document.getElementById('Form');
        var a=document.getElementById('newpwd').value
        var b=document.getElementById('cnewpwd').value
        if (a==b){
            // alert('修改成功')
            // return true
            alert('修改成功')
            var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
            console.log(index)
            parent.layer.close(index);//关闭窗口
            return true

        }else {
            alert('两次输入密码不一致，请重新输入')
            return false;
        }
    }
</script>


</body>
</html>